<?php
/**
 * Video Adapter Abstract
 *
 * Abstract adapter class, when writing future adapter 
 * for video processing it must extend this, so that 
 * no other functionality will break
 *
 * @category   Core
 * @package    Core_Video
 * @subpackage Core_Video_Adapter
 * @copyright 
 * @author     Sandeep Manne<sandeep.manne@costrategix.com>
 */

abstract class Core_Video_Adapter_Abstract
{
	public $fileName = null;
	
	const POSITION_TOP_LEFT = 'top-left';
    const POSITION_TOP_RIGHT = 'top-right';
    const POSITION_BOTTOM_LEFT = 'bottom-left';
    const POSITION_BOTTOM_RIGHT = 'bottom-right';
    const POSITION_STRETCH = 'stretch';
    const POSITION_TILE = 'tile';
    const POSITION_CENTER = 'center';
    
    protected $_fileType = null;
    protected $_fileName = null;
    protected $_fileMimeType = null;
    protected $_fileSrcName = null;
    protected $_fileSrcPath = null;
    protected $_videoHandler = null;
    protected $_videoSrcWidth = null;
    protected $_videoSrcHeight = null;
    protected $_requiredExtensions = null;
    protected $_watermarkPosition = null;
    protected $_watermarkWidth = null;
    protected $_watermarkHeigth = null;
    protected $_watermarkImageOpacity = null;
    protected $_quality = null;
    protected $_metaData = null;
    
    protected $_keepAspectRatio;
    
    abstract public function open($fileName);

    abstract public function save($destination=null, $newFileName=null);

    abstract public function resize($width=null, $height=null);

    abstract public function rotate($angle);

    abstract public function crop($top=0, $left=0, $right=0, $bottom=0);

    abstract public function watermark($watermarkImage, $ImageWidth, $ImageHeight, $positionX=0, $positionY=0);

    abstract public function checkDependencies();
    
    public function getMimeType()
    {
    	return mime_content_type($this->_fileName);
    }
    
    abstract public function getOriginalWidth();
    
    abstract public function getOriginalHeight();
    
    abstract public function keepAspectRatio($value = null);
    
    abstract public function getDuration();
    
    abstract public function getBitRate();
    
    abstract public function getMetaData();
    
    abstract public function getSupportedTypes();
    
    abstract public function getThumbnail($time, $size, $outputFileName);
    
    abstract public function quality($value = null);
}